<!--# 
layout("/layout/default.html",{"menu":["settings",""],"breadcrumbs":[{"name":"信息设置"}]}){ 
 #-->

<div class="space-4"></div>
<div class="row">
	<div class="col-md-8 col-md-offset-2 col-sm-12">
		<div class="panel panel-info">
			<div class="panel-heading">
				<h3 class="panel-title">个人信息设置</h3>
			</div>
			<div class="panel-body">
				<form id="settingsForm" class="cmxform form-horizontal adminex-form" novalidate="novalidate">
					<div class="form-group ">
						<label for="用户名" class="control-label col-lg-3">姓名 : </label>
						<div class="col-lg-9">
							<input class="form-control" type="text" placeholder="请输入姓名" name="realName" data-type='required' data-error='请输入姓名' value="${obj.data.user.realName !}" />
						</div>
					</div>

					<div class="form-group ">
						<label class="control-label col-lg-3"> 电话 : </label>
						<div class="col-lg-9">
							<input class="form-control" type="text" placeholder="请输入电话号码" name="phone" data-type='phone' data-error='请输入电话号码' value="${obj.data.user.phone!}">
						</div>
					</div>

					<div class="form-group ">
						<label class="control-label col-lg-3"> 邮箱 : </label>
						<div class="col-lg-9">
							<input class="form-control" type="text" placeholder="请输入邮箱" name="email" data-type='email' data-error='请输入邮箱' value="${obj.data.user.email!}">
						</div>
					</div>

					<div class="form-group ">
						<label class="control-label col-lg-3"> 密码 : </label>
						<div class="col-lg-9">
							<button type="button" class="btn btn-sm btn-primary" onclick="changePwd()">修改密码</button>
						</div>
					</div>

					<div class="pull-right" style="margin-right: 45px">
						<button type="button" class="btn btn-sm btn-primary" onclick="save(this)">
							<i class="fa fa-save"></i> 提交
						</button>
						<button class="btn btn-sm btn-default btn-back">
							<i class="fa fa-undo"></i> 返回
						</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
<!--
	function save(btn) {
		if ($('#settingsForm').find('input').validation()) {//验证表单
			$.post(getRootPath() + '/system/settings/save', $('#settingsForm').serialize(), function(result) {
				console.log(result);
				if (result.operationState == 'SUCCESS') {
					showMessage("设置成功!");
					setTimeout(function() {
						location.reload();
					}, 2000);
				} else {
					validationFail(result.data.reason, btn);
				}
			}, 'json');
		}
	}

	function changePwd() {
		openUrl("/system/changePassword", "修改密码", 400, 375, false);
	}
//-->
</script>
<!--# } #-->